<include file="../Public/header" />
<div id="content">
    <div id="user-weibo-list" data-title="{$datatitle}" date-selected="true" data-footer="none" data-rememberScroll="true">
        <header>
            <div id="header-buttons">
                <a href="javascript:history.go(-1);">
                    <div id="back" class="header-menu-link" data-back="false">
                    </div>
                </a>

                <div id="messageLink" class="header-menu-link"><a href="{:U('w3g/Index/msgbox')}"><i class="num"></i></a></div>
        <div id="menuLink" class="header-menu-link"></div>
            </div>
            <h1 class="hasback">
                {$datatitle}
            </h1>
        </header>
        <!-- 个人信息 -->
        <div id="i_info">
            <div id="i_info_top">
                <div class="i_info_img"><img width="100%" src="{:APPS_URL}/w3g/_static/img/sys/profile_img.png"></div>
                <div id="i_info_top_ava">
                    <!-- 头像 -->
                    <img src="{$profile['avatar_big']}" width="70" height="70" >
                </div>
                <div id="i_info_top_box">
                    <div id="i_info_top_name">
                        <!-- 帐号昵称 -->
                        {$profile['uname']}
                    </div>
                    <div id="i_info_top_signature">
                        <php>if($profile['uid']==$_SESSION['mid']){</php>
                        <!--<div id="iitsb">
                            {$profile['intro']}
                        </div>-->
                        <php>}</php>
                        <!-- <div id="i_info_sendmsg" class="i_info_button">发私信</div> -->
                        <php>if($profile['uid'] != $mid) { </php>
                            <eq name="sendmsg" value="1">
                            <div id="post-msg-to-uid" class="i_info_button i_info_msg pure-button pure-button-cc ts-listen" data-listen="weibo-tosendmsg" data-uname="{$profile['uname']}" data-uid="{$profile['uid']}">发私信</div>
                            </eq>
                            <php>if(!$profile['follow_state']['following']){</php>
                                <div id="i_info_follow" class="i_info_button pure-button pure-button-cc ts-listen" data-listen="weibo-follow-follow" linkto="{:U('w3g/Index/doFollow',array('from'=>'weibo','type'=>'follow','user_id'=>$profile['uid']))}">加关注</div>
                            <php>}else {</php>
                                <div id="i_info_follow" class="i_info_button i_info_followed pure-button pure-button-cc ts-listen" data-listen="weibo-follow-unfollow" linkto="{:U('w3g/Index/doFollow',array('from'=>'weibo','type'=>'unfollow','user_id'=>$profile['uid']))}">取消关注</div>
                            <php>}</php>
                        <php>}else{</php>
                            <!-- <a href="{:U('w3g/Index/msgbox')}" class="pure-button pure-button-cc">消息盒子</a> -->
                            <a href="{:U('w3g/Setting/base')}" class="pure-button pure-button-cc">编辑资料</a>
                            <a href="#new-weibo" class="pure-button pure-button-cc">发分享</a>
                        <php>}</php>
                    </div>
                </div>
            </div>
        </div>
        <!-- 个人信息结束 -->
        <php>if($isAllowed == 0){</php>
        <div class="no_authority">-_-。sorry！根据对方隐私设置，您无权查看TA的主页</div>
        <php>}else{</php>
            <php>
                if($profile['uid'] != $mid){
                    $iicb='i_info_counts_box';
                }else{
                    $iicb='i_info_counts_box_i';
                }
                if($type=='user_following'){
                    $following_highlight = 'highlight';
                    $followers_highlight = '';
                }else{
                    $following_highlight = '';
                    $followers_highlight = 'highlight';
                }
            </php>
            <div id="i_info_counts">
                <php>if($profile['uid']!=$_SESSION['mid']){</php>
                    <div id="i_info_counts_box_weibo" class="{$iicb}" onclick="javascript:window.open('{:U('w3g/Index/profile','uid='.$profile['uid'])}','_self')">
                        <div class="i_info_counts_title">详细</div>
                        <div class="i_info_counts_title">资料</div>
                    </div>
                <php>}</php>
                    <div id="i_info_counts_box_weibo" class="{$iicb}" onclick="javascript:window.open('{:U('w3g/Index/weibo','uid='.$profile['uid'])}','_self')">
                        <div class="i_info_counts_num">{$profile.count_info.feed_count}</div>
                        <div class="i_info_counts_title">分享</div>
                    </div>
                    <div id="i_info_counts_box_guanzhu" class="{$iicb} {$following_highlight}" uid="{$profile.uid}" onclick="javascript:window.open('{:U('w3g/Index/following','uid='.$profile['uid'])}','_self')">
                        <div class="i_info_counts_num">{$profile.count_info.following_count}</div>
                        <div class="i_info_counts_title">关注</div>
                    </div>
                    <div id="i_info_counts_box_fensi" class="{$iicb} {$followers_highlight}" onclick="javascript:window.open('{:U('w3g/Index/followers','uid='.$profile['uid'])}','_self')">
                        <div class="i_info_counts_num">{$profile.count_info.follower_count}</div>
                        <div class="i_info_counts_title">粉丝</div>
                    </div>
                <php>if($profile['uid']==$_SESSION['mid']){</php>
                    <div id="i_info_counts_box_shoucang" class="{$iicb}" onclick="javascript:window.open('{:U('w3g/Index/favorite')}','_self')">
                        <div class="i_info_counts_num">{$profile.count_info.favorite_count}</div>
                        <div class="i_info_counts_title">收藏</div>
                    </div>
                <php>}</php>
            </div>
        <!-- list -->
        <volist name="userlist" id="userlist">
            <div class="fensi_box ts-listen" data-listen="weibo-userpage-{$userlist.user.uid}" uid="{$userlist.user.uid}">
                <div class="fensi_box_ava">
                    <img src="{$userlist.user.avatar_small}" width=50 height=50>
                </div>
                <div class="fensi_box_info">
                    <div class="fensi_box_info_name">{$userlist.user.uname}</div>
                    <div class="fensi_box_info_intro">{$userlist['user']['intro']|default=暂无简介}</div>
                </div>
                <!-- <php>if($userlist[user][follow_state][value] === '加关注'){
                        if($userlist[user][uid]!=$_SESSION[mid]){
                </php>
                    <div class="fensi_box_guanzhu_button ts-listen highlight" data-listen="weibo-follow-follow" data-userid="{$userlist['user']['uid']}" data-page="{$page}" data-key="{$keyword}" data-type="{$type}" data-isfollower="{$userlist[user][follow_state][follower]}">
                        {$userlist.user.follow_state.value}
                    </div>
                <php>}}else{</php>
                    <div class="fensi_box_guanzhu_button ts-listen" data-listen="weibo-follow-unfollow" data-userid="{$userlist['user']['uid']}" data-page="{$page}" data-key="{$keyword}" data-type="{$type}" data-isfollower="{$userlist[user][follow_state][follower]}">
                        {$userlist.user.follow_state.value}
                    </div>
                <php>}</php> -->
            </div>
        </volist>
        <!-- list end -->
    <php>if($count>10){</php>
    <!-- 分页 -->
    <php>$url = $type=='user_following'?'w3g/Index/following':'w3g/Index/followers'</php>
    <div id="pager_box">
        <php>if(empty($_GET['page']) || $_GET['page']==1){</php>
            <a href="javascript:;" link="" id="prev" class="pager_child pager_p_n_none pure-button pure-button-disabled">上一页</a>
        <php>}else{</php>
            <a href="{:U($url,array('uid'=>$profile['uid'],'page'=>$page-1))}" id="prev" class="pager_child pager_p_n pure-button  pure-button-primary">上一页</a>
        <php>}</php>
        <select id="page_sel" class="pager_child pure-button ts-listen" data-listen="weibo-pagerSelect-change">
            <php>
                $_GET['page']!=0?$get=$_GET['page']:$get=1;
                $_count = ceil($count/10);
                if($get<6){
                    for($i=0;$i<($_count);$i++){
                        $get==$i+1?$selected='selected="selected"':$selected='';
                        if($i>9){
                            break;
                        }
            </php>
            <option value="{:U($url)}&page={$i+1}&uid={$profile['uid']}" <php>echo $selected;</php>>第{$i+1}页</option>
            <php>   }
                }elseif($get>=6){
                    for($i=($get-5);$i<$get;$i++){
                        $get==$i+1?$selected='selected="selected"':$selected='';
            </php>
            <option value="{:U($url)}&page={$i+1}&uid={$profile['uid']}" <php>echo $selected;</php>>第{$i+1}页</option>
            <php>   }</php>
            <php>   for($i=$get;$i<($get+5);$i++){
                        $get==$i+1?$selected='selected="selected"':$selected='';
                        if($i>$_count-1){
                            break;
                        }
            </php>
            <option value="{:U($url)}&page={$i+1}&uid={$profile['uid']}" <php>echo $selected;</php>>第{$i+1}页</option>
            <php>   }</php>
            <php>}</php>
            
        </select>
        <php>if($get == ($_count)) {</php>
            <a href="javascript:;" link="" id="next" class="pager_child pager_p_n_none pure-button pure-button-disabled">下一页</a>
        <php>}else{</php>
            <a href="{:U($url,array('uid'=>$profile['uid'],'page'=>$page+1))}" id="next" class="pager_child pager_p_n pure-button pure-button-primary">下一页</a>
        <php>}</php>
    </div>
     <php>}</php>
     <php>}</php>
</div>
    <!-- 列表结束################################################################################################ -->

<include file="../Public/footer" />
